using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Target_StandMap : EntityTypeConfiguration<Target_Stand>
    {
        public Target_StandMap()
        {
            // Primary Key
            this.HasKey(t => t.Stand_ID);

            // Properties
            this.Property(t => t.Stand_Name)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.To_standID)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.diameter)
                .HasMaxLength(50);

            this.Property(t => t.length)
                .HasMaxLength(50);

            this.Property(t => t.TargetName)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Stand_Info)
                .HasMaxLength(20);

            this.Property(t => t.Stand_BZ)
                .HasMaxLength(100);

            this.Property(t => t.Stand_special1)
                .HasMaxLength(20);

            this.Property(t => t.Stand_special2)
                .HasMaxLength(20);

            this.Property(t => t.No_content)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.num_time)
                .HasMaxLength(20);

            this.Property(t => t.mi)
                .HasMaxLength(20);

            this.Property(t => t.label)
                .HasMaxLength(20);

            this.Property(t => t.TargetName2)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Target_Stand");
            this.Property(t => t.Stand_ID).HasColumnName("Stand_ID");
            this.Property(t => t.Stand_Name).HasColumnName("Stand_Name");
            this.Property(t => t.To_standID).HasColumnName("To_standID");
            this.Property(t => t.Target_ID).HasColumnName("Target_ID");
            this.Property(t => t.diameter).HasColumnName("diameter");
            this.Property(t => t.length).HasColumnName("length");
            this.Property(t => t.Stand_detail_ID).HasColumnName("Stand_detail_ID");
            this.Property(t => t.TargetName).HasColumnName("TargetName");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Stand_Info).HasColumnName("Stand_Info");
            this.Property(t => t.Stand_BZ).HasColumnName("Stand_BZ");
            this.Property(t => t.Stand_special1).HasColumnName("Stand_special1");
            this.Property(t => t.Stand_special2).HasColumnName("Stand_special2");
            this.Property(t => t.No_content).HasColumnName("No_content");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.Create_Time).HasColumnName("Create_Time");
            this.Property(t => t.Update_Time).HasColumnName("Update_Time");
            this.Property(t => t.Ljsc).HasColumnName("Ljsc");
            this.Property(t => t.num_time).HasColumnName("num_time");
            this.Property(t => t.mi).HasColumnName("mi");
            this.Property(t => t.label).HasColumnName("label");
            this.Property(t => t.TargetName2).HasColumnName("TargetName2");
        }
    }
}
